//
//  ZCLogisticsExpressInfoCell.m
//  ZCJZ
//
//  Created by sujeking on 2019/3/7.
//  Copyright © 2019年 jeking. All rights reserved.
//

#import "ZCLogisticsExpressInfoCell.h"
#import "generalToolBox.h"
#import <UIImageView+WebCache.h>
@interface ZCLogisticsExpressInfoCell()

@property (weak, nonatomic) IBOutlet UIImageView *imv;
@property (weak, nonatomic) IBOutlet UILabel *numLabel;
@property (weak, nonatomic) IBOutlet UILabel *expressNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *logisticSNLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;

@end

@implementation ZCLogisticsExpressInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupSubViews];
}

- (void)setupSubViews {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
  self.imv.backgroundColor = [generalToolBox getColorWithHexadecimalColorStr:@"0xf4f4f4"];
    self.imv.layer.borderWidth = 0.5f;
    self.imv.layer.borderColor = [generalToolBox getColorWithHexadecimalColorStr:@"0xf4f4f4"].CGColor;

    self.numLabel.hidden = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}


- (void)setDict:(NSDictionary *)dict {
    _dict = dict;
    
    [self.imv sd_setImageWithURL:[NSURL URLWithString:[dict valueForKey:@"thumb"]] placeholderImage:[UIImage imageNamed:@"picon"] options:SDWebImageAllowInvalidSSLCertificates];

    NSString *name = [dict valueForKey:@"logistics_name"];
    NSString *sn = [dict valueForKey:@"logistics_sn"];
    NSString *phone = [dict valueForKey:@"phone"];

    if (name == nil || name.length == 0) {
        name = @"无";
    }
    
    if (sn == nil || sn.length == 0) {
        sn = @"无";
    }
    
    if (phone == nil || phone.length == 0) {
        phone = @"无";
    }
    
    self.expressNameLabel.text = [NSString stringWithFormat:@"配送企业:%@",name];
    self.logisticSNLabel.text = [NSString stringWithFormat:@"快递单号:%@",sn];
    self.phoneLabel.text = [NSString stringWithFormat:@"联系电话:%@",phone];
    

}

@end
